package com.demo.mb;

import com.demo.msg.Msgtype;
import com.jfinal.kit.StringKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

import java.util.List;

@SuppressWarnings("serial")
public class WxMb extends Model<WxMb>{
    public static final WxMb dao = new WxMb();
 
    //columns START
    private String ID = "id";  //
    private String SJ_LBID = "sj_lbid";  //
    private String DSPORDER = "dsporder";  //显示顺序
    private String MBMC = "mbmc";  //类别名称
    private String BZ = "bz";  //备注
    private String YXBZ = "yxbz";  //有效标志
	private String MBURL="mburl";  //类别编号
	private String BJZT="bjzt";//编辑状态
	private String PICURL="picurl";// 图片路径
	private String  MBLX="mblx";//模板类型
	private String MUSIC="music";//音乐
    public void setId(int value) {
        set(ID, value);
    }

	public int getId() {
		return get(ID);
	}

    public void setDsporder(int value) {
        set(DSPORDER, value);
    }

	public int getDsporder() {
		return get(DSPORDER);
	}

    public void setBz(String value) {
        set(BZ, value);
    }

	public String getBz() {
		return get(BZ);
	}
    public void setYxbz(String value) {
        set(YXBZ, value);
    }

	public String getYxbz() {
		return get(YXBZ);
	}

    public String getSJ_LBID() {
        return SJ_LBID;
    }

    public void setSJ_LBID(String SJ_LBID) {
        this.SJ_LBID = SJ_LBID;
    }
    public String getMBMC() {
		return MBMC;
	}

	public void setMBMC(String mBMC) {
		MBMC = mBMC;
	}

	public String getMBURL() {
		return MBURL;
	}

	public void setMBURL(String mBURL) {
		MBURL = mBURL;
	}
	public String getPICURL() {
		return PICURL;
	}

	public void setPICURL(String pICURL) {
		PICURL = pICURL;
	}

	public String getBJZT() {
		return BJZT;
	}

	public void setBJZT(String bJZT) {
		BJZT = bJZT;
	}

    
	//columns END
    public List<Record> findtree(String where) {
    	String order =" order by dsporder";
        return  Db.find("select *,mbmc as name, sj_lbid as pId from wx_mb " + where+order);
    }

    public List<WxMb> findAll() {
        return find("select * from wx_mb");
    }

    public Page<WxMb> page(int pageNumber, int pageSize, String where) {
        String sqlExp = "from  wx_mb";
        if(StringKit.notBlank(where)){
            sqlExp += " where " + where;
        }
        return paginate(pageNumber, pageSize, "select *", sqlExp);
    }

	public String getMBLX() {
		return MBLX;
	}

	public void setMBLX(String mBLX) {
		MBLX = mBLX;
	}

	public String getMUSIC() {
		return MUSIC;
	}

	public void setMUSIC(String mUSIC) {
		MUSIC = mUSIC;
	}


}

